@extends('admin.layouts')
@section('main')
    <div class="edit-subcat" style="display: block;">
        <form id="form1" class="layui-form layui-form-pane" action="{{url('admin/usereditrole')}}">
            {{csrf_field()}}
            <input type="hidden" name="id" value="{{$data->id}}">
            <div class="layui-form-item">
                <label class="layui-form-label w150">{{trans('config.user')}}</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" value="{{$data->name}}" class="layui-input" disabled style="background-color:#eee;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label w150">{{trans('config.have_role')}}</label>
                <div class="layui-input-block layui-text-left">
                    @foreach($role as $k=>$v)
                        <input type="checkbox" name="role[{{$k}}]"
                               @if(in_array($v->id,$child))
                               checked="checked"
                               @endif title="{{$v->name}}" value="{{$v->id}}">
                    @endforeach
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" jq-submit jq-filter="submit">{{trans('config.btn_submit')}}</button>
                </div>
            </div>
        </form>
    </div>
@endsection

@section('script')

<script>
    layui.use('simpleform');
</script>
@endsection